home *** CD-ROM | disk | FTP | other *** search
- /*
- MiniDisplay - TransDisplay Demonstration. Very simple: just
- demonstrates the various output calls.
-
- The project should include MiniDisplay.c (this file),
- TransDisplay.c (or a project made from TransDisplay.c),
- TransSkel.c (or a project made from TransSkel.c), and MacTraps.
-
- 4 October 1986 Paul DuBois
- */
-
- # include <MenuMgr.h>
- # include "TransDisplay.h"
-
-
-
- DoFileMenu (item)
- int item; /* ignored - there's only Quit */
- {
- SkelWhoa (); /* tell SkelMain to quit */
- }
-
-
- main ()
- {
- Rect r;
- MenuHandle m;
- WindowPtr w;
-
- SkelInit (); /* initialize */
- SkelApple (nil, nil); /* handle desk accessories */
-
- m = NewMenu (2, "\pFile"); /* create menu */
- AppendMenu (m, "\pQuit/Q");
- SkelMenu (m, DoFileMenu, nil); /* tell TransSkel to handle it */
-
- SetRect (&r, 100, 75, 400, 250);
- w = NewDWindow (&r, "\pMiniDisplay", false, -1L, false, 0L);
-
- DisplayString ("\pThis is MiniDisplay, a minimal demonstration of ");
- DisplayString ("\pTransDisplay. The following types of output may ");
- DisplayString ("\pbe written with the built-in output calls:\r");
-
- DisplayString ("\p\rArbitrary length text: ");
- DisplayText ("Some text", 9L);
- DisplayString ("\p\rString: ");
- DisplayString ("\p\"\\pThis is a string.\"");
- DisplayString ("\p\rChar: '");
- DisplayChar ('x');
- DisplayString ("\p' Hex char: ");
- DisplayHexChar ('x');
- DisplayString ("\p\rInt: ");
- DisplayInt (1023);
- DisplayString ("\p Hex int: ");
- DisplayHexInt (1023);
- DisplayString ("\p\rLong: ");
- DisplayLong (32768L);
- DisplayString ("\p Hex long: ");
- DisplayHexLong (32768L);
- DisplayString ("\p\rBoolean: ");
- DisplayBoolean (true);
- DisplayString ("\p, ");
- DisplayBoolean (false);
- DisplayString ("\p\rCarriage return. ");
- DisplayString ("\p\r\rSelect Quit from the File menu to exit.");
- SetDWindowPos (w, 0); /* scroll back to top */
- ShowWindow (w);
-
- SkelMain (); /* loop 'til Quit selected */
- SkelClobber (); /* clean up */
- }
-